Show a list of mods required to be enabled or disabled when mod is toggled - #200
Show a list of mods required to be enabled or disabled when mod is toggled#200dkhex wants to merge 8 commits into
Conversation
… mod is toggled Signed-off-by: dkhex <dk-hex@yandex.ru>
|
lgtm |
notwindstone
left a comment
There was a problem hiding this comment.
thanks for the contribution!
|
Okay, how many rows of text is acceptable for a QMessageBox? Or, maybe (if I don't be a lazy ass) I'll try to turn it into custom widget with scrollable list of affected mods. |
QMessageBox has the detailedText property which allows to dialog contain text of any length |
|
so we can make to show like 5 mods and then "and N more mods..." |
fractal-l
left a comment
There was a problem hiding this comment.
consider using setDetailedText() or add new constructor: instead of outputting each mod name in message clamp it to first five and add "and N mods more..." in the end
show full list in detailedText
…en mod is toggled Signed-off-by: dkhex <dk-hex@yandex.ru>
so5iso4ka
left a comment
There was a problem hiding this comment.
Fix that; other than that, I like everything.
|
im not sure that we need these hacks |
Signed-off-by: dkhex <dk-hex@yandex.ru>
Signed-off-by: dkhex <dk-hex@yandex.ru>
| return QString("- %1 (%2)").arg(mod->name(), mod->version()); | ||
| } | ||
|
|
||
| ModToggleConfirmDialog::ModToggleConfirmDialog(QWidget* parent, QSet<Mod*> toEnable, QSet<Mod*> toDisable) |
There was a problem hiding this comment.
pass QSet by const-reference
| ModToggleConfirmDialog::ModToggleConfirmDialog(QWidget* parent, QSet<Mod*> toEnable, QSet<Mod*> toDisable) | |
| ModToggleConfirmDialog::ModToggleConfirmDialog(QWidget* parent, const QSet<Mod*>& toEnable, const QSet<Mod*>& toDisable) |
| ui->rejectButton->setIcon(style()->standardIcon(QStyle::SP_DialogCancelButton)); | ||
| ui->cancelButton->setIcon(style()->standardIcon(QStyle::SP_DialogCloseButton)); | ||
|
|
||
| if (toEnable.size() > 0 || toDisable.size() > 0) |
There was a problem hiding this comment.
this statement is always true
| if (toEnable.size() > 0 || toDisable.size() > 0) | |
| if (toEnable.isEmpty() || toDisable.isEmpty()) |
|
|
||
| static QString formatMod(Mod* mod) | ||
| { | ||
| return QString("- %1 (%2)").arg(mod->name(), mod->version()); |
There was a problem hiding this comment.
sadly version can be empty
| return QString("- %1 (%2)").arg(mod->name(), mod->version()); | |
| if (mod->version().isEmpty()) return QString("- %1").arg(mod->name()); | |
| return QString("- %1 (%2)").arg(mod->name(), mod->version()); |
| void ModToggleConfirmDialog::onAcceptButtonClicked() | ||
| { | ||
| done(QMessageBox::Yes); | ||
| } | ||
|
|
||
| void ModToggleConfirmDialog::onRejectButtonClicked() | ||
| { | ||
| done(QMessageBox::No); | ||
| } | ||
|
|
||
| void ModToggleConfirmDialog::onCancelButtonClicked() | ||
| { | ||
| done(QMessageBox::Cancel); | ||
| } |
There was a problem hiding this comment.
messed up types (using QMessageBox in QDialog)
consider using QDialog::DialogCode since you don't really need to distinguish reject and cancel buttons
There was a problem hiding this comment.
But I need to distinguish "toggle required" and "toggle only selected", so I made own codes.
Signed-off-by: dkhex <dk-hex@yandex.ru>
Signed-off-by: dkhex <dk-hex@yandex.ru>
Signed-off-by: dkhex <dk-hex@yandex.ru>
Signed-off-by: dkhex <dk-hex@yandex.ru>
|
Thanks for the feedback. |




A simple QoL addition to "Confirm toggle/enable/disable" MessageBox.